package com.mobbanana.gamehook

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import android.widget.Button
import android.widget.EditText
import com.mobbanana.gamehook.utils.SPUtil

class ConfigActivity : AppCompatActivity(), View.OnClickListener {

    private var mETPackageName: EditText? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_config)
        initView()
    }

    private fun initView() {
        findViewById<Button>(R.id.btn_save_pkg).setOnClickListener { savePackageName() }
        mETPackageName = findViewById(R.id.et_packageName)
    }

    private fun savePackageName() {
        var packageName = mETPackageName!!.text.toString()
        SPUtil.putString(this, "hook_package_name", packageName)
    }

    override fun onClick(v: View?) {
        TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
    }
}
